var $ = require('../../../utils/helper.js'), that = null
var app = getApp()
Page({
  data: {
    // voteTitle:null,
    // input_value:null
  },
  onLoad(e) {
    that = this
  },
  onShow: function () {
    $.check(that)
  },
  onReady: function () {

  },
  init: function () {
    that.consultlist()
    that.headerimg()
  },
  consultlist:function(){
    $.post("api/news/lists",null,function(list){
      that.setData({list:list})
    })
  },
 
  headerimg: function () {
    $.post("api/index/advert", {type:1}, function (advert) {
      that.setData({ advert: advert })
    })
  },

  set_input: function (e) {
    that.setData({ input_value: e.detail.value })
  },
    
  search:function(){
    $.post("api/news/lists", { search: that.data.input_value }, function (list) {
        that.setData({ list: list })
      })
  }

}) 